// source --> https://www.caroana.com.br/wp-content/plugins/photo-gallery/js/bwg_frontend.js?ver=1.4.7 jQuery(document).ready(function () { bwg_document_ready(); jQuery(".bwg-thumbnails").each(function () { bwg_all_thumnails_loaded(this); }); }); jQuery(window).on("resize", function () { jQuery(".bwg-thumbnails").each(function () { bwg_all_thumnails_loaded(this); }); }); function bwg_all_thumnails_loaded(that) { var thumbnails_count = 0; var thumbnails_loaded = jQuery(that).find("img").length; jQuery(that).find("img").each(function () { var fakeSrc = jQuery(this).attr("src"); jQuery("").attr("src", fakeSrc).on("load error", function() { if ( ++thumbnails_count >= thumbnails_loaded ) { bwg_thumbnail(that); } }); }); } function bwg_container_loaded(bwg) { jQuery('#gal_front_form_' + bwg).removeClass('bwg-hidden'); jQuery('#ajax_loading_' + bwg).addClass('bwg-hidden'); } function bwg_thumbnail(that) { var container_width = jQuery(that).width(); var thumb_width = jQuery(that).data("thumbnail-width"); var max_count = jQuery(that).data("max-count"); var column_count = parseInt(container_width / thumb_width) + 1; if (column_count > max_count) { column_count = max_count; } /*var flex = 1 / column_count;*/ var min_width = 100 / column_count; var bwg_item = jQuery(that).find(".bwg-item"); bwg_item.css({ /*flexGrow: flex,*/ width: min_width + "%" }); jQuery(that).children(".bwg-item").each(function () { var image = jQuery(this).find("img"); var item2 = jQuery(this).find(".bwg-item2"); if ( (item2.width() / item2.height()) > (image.width() / image.height()) ) { if ( item2.width() > image.width() ) { image.css({width: "100%"}); } else { image.css({maxWidth: "100%"}); } } else { if ( item2.height() > image.height() ) { image.css({height: "100%"}); } else { image.css({maxHeight: "100%"}); } } jQuery(this).find(".bwg-item2").css({ marginLeft: (item2.width() - image.width()) / 2, marginTop: (item2.height() - image.height()) / 2 }); }); bwg_container_loaded(jQuery(that).data('bwg')); } function bwg_document_ready() { var bwg_touch_flag = false; jQuery( ".bwg_lightbox" ).on( "click", function () { if ( !bwg_touch_flag ) { bwg_touch_flag = true; setTimeout( function () { bwg_touch_flag = false; }, 100 ); bwg_gallery_box( jQuery( this ).attr( "data-image-id" ), jQuery( this ).closest( '.bwg_container' ) ); return false; } } ); jQuery( ".bwg_lightbox .bwg_ecommerce" ).on( "click", function ( event ) { event.stopPropagation(); if ( !bwg_touch_flag ) { bwg_touch_flag = true; setTimeout( function () { bwg_touch_flag = false; }, 100 ); var image_id = jQuery( this ).closest( ".bwg_lightbox" ).attr( "data-image-id" ); bwg_gallery_box( image_id, jQuery( this ).closest( '.bwg_container' ), true ); return false; } } ); jQuery( 'div[id^="bwg_container"]' ).each( function () { var bwg_container = jQuery( this ); if ( bwg_container.data( 'right-click-protection' ) ) { /* Disable right click.*/ bwg_container.bind( "contextmenu", function () { return false; } ); bwg_container.css( 'webkitTouchCallout', 'none' ); } var search_tags = bwg_container.find('.search_tags'); if (search_tags.length) { search_tags.SumoSelect( { placeholder: bwg_objectsL10n.bwg_select_tag, search: 1, searchText: bwg_objectsL10n.bwg_search, forceCustomRendering: true } ); } } ); var bwg_hash = window.location.hash.substring( 1 ); if ( bwg_hash ) { if ( bwg_hash.indexOf( "bwg" ) != "-1" ) { bwg_hash_array = bwg_hash.replace( "bwg", "" ).split( "/" ); var bwg_container = jQuery( '.bwg_container[data-gallery-id=' + bwg_hash_array[0] + ']' ); if ( bwg_container ) { bwg_gallery_box( bwg_hash_array[1], bwg_container ); } } } } function bwg_clear_search_input (current_view) { jQuery("#bwg_search_input_" + current_view).val(''); } function bwg_check_search_input_enter(that, e) { var key_code = e.which || e.keyCode; if (key_code == 13) { jQuery(that).closest('.bwg_search_container_1').find('.bwg_search').trigger('click'); return false; } return true; } function bwg_gallery_box(image_id, bwg_container, openEcommerce) { if(typeof openEcommerce == undefined){ openEcommerce = false; } var bwg = bwg_container.data('bwg'); var bwg_lightbox_url = bwg_container.data('lightbox-url'); var filterTags = jQuery("#bwg_tags_id_bwg_standart_thumbnails_" + bwg ).val(); filterTags = filterTags ? filterTags : 0; var ecommerce = openEcommerce == true ? "&open_ecommerce=1" : ""; var filtersearchname = jQuery("#bwg_search_input_" + bwg ).val(); filtersearchname = filtersearchname ? filtersearchname : ''; spider_createpopup(bwg_lightbox_url + '&image_id=' + image_id + "&filter_tag=" + filterTags + ecommerce + '&filter_search_name=' + filtersearchname, bwg, bwg_container.data('popup-width'), bwg_container.data('popup-height'), 1, 'testpopup', 5, bwg_container.data('buttons-position')); } function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_album_id, type, srch_btn, title, sortByParam, load_more, description) { var masonry_loaded = 0; var mosaic_loaded = 0; if (typeof load_more == "undefined") { var load_more = false; } var page_number = jQuery("#page_number_" + current_view).val(); var bwg_load_more = jQuery("#bwg_load_more_" + current_view).val(); var bwg_previous_album_ids = jQuery('#bwg_previous_album_id_' + current_view).val(); var bwg_previous_album_page_numbers = jQuery('#bwg_previous_album_page_number_' + current_view).val(); var post_data = {}; if (album_gallery_id == 'back') { // Back from album. var bwg_previous_album_id = bwg_previous_album_ids.split(","); album_gallery_id = bwg_previous_album_id[1]; jQuery('#bwg_previous_album_id_' + current_view).val(bwg_previous_album_ids.replace(bwg_previous_album_id[0] + ',', '')); var bwg_previous_album_page_number = bwg_previous_album_page_numbers.split(","); page_number = bwg_previous_album_page_number[0]; jQuery('#bwg_previous_album_page_number_' + current_view).val(bwg_previous_album_page_numbers.replace(bwg_previous_album_page_number[0] + ',', '')); post_data["action_" + current_view] = 'back'; } else if (cur_album_id != '') { // Enter album (not change the page). jQuery('#bwg_previous_album_id_' + current_view).val(album_gallery_id + ',' + bwg_previous_album_ids); if (page_number) { jQuery('#bwg_previous_album_page_number_' + current_view).val(page_number + ',' + bwg_previous_album_page_numbers); } page_number = 1; } if (srch_btn) { // Start search. page_number = 1; } if (typeof title == "undefined" || title == '') { var title = ""; } if (typeof description == "undefined" || description == '') { var description = ""; } if (typeof sortByParam == "undefined" || sortByParam == '') { var sortByParam = jQuery(".bwg_order_" + current_view).val(); } post_data["page_number_" + current_view] = page_number; post_data["bwg_load_more_" + current_view] = bwg_load_more; post_data["album_gallery_id_" + current_view] = album_gallery_id; post_data["bwg_previous_album_id_" + current_view] = jQuery('#bwg_previous_album_id_' + current_view).val(); post_data["bwg_previous_album_page_number_" + current_view] = jQuery('#bwg_previous_album_page_number_' + current_view).val(); post_data["type_" + current_view] = type; post_data["title_" + current_view] = title; post_data["description_" + current_view] = description; post_data["sortImagesByValue_" + current_view] = sortByParam; if (jQuery("#bwg_search_input_" + current_view).length > 0) { // Search box exists. post_data["bwg_search_" + current_view] = jQuery("#bwg_search_input_" + current_view).val(); } post_data["bwg_tag_id_" + id] = jQuery("#bwg_tag_id_" + id).val(); // Loading. if ( id != "bwg_standart_thumbnails_" + current_view ) { jQuery("#ajax_loading_" + current_view).css('display', ''); } else { jQuery("#ajax_loading_" + current_view).removeClass('bwg-hidden'); } jQuery.ajax({ type: "POST", url: window.location, data: post_data, success: function (data) { masonry_loaded = jQuery(data).find('#' + form_id).find(".bwg_masonry_thumb_spun_" + current_view + " img").length; mosaic_loaded = jQuery(data).find('#' + form_id).find(".bwg_mosaic_thumb_spun_" + current_view + " img").length; if (load_more) { var strr = jQuery(data).find('#' + id).html(); jQuery('#' + id).append(strr); jQuery("div[id^='bwg_container1_'] form").each(function () { if (jQuery(this).data("current") == current_view) { var str = jQuery(data).find('.bwg_nav_cont_' + current_view).html(); jQuery('.bwg_nav_cont_' + current_view).html(str); } else { var str = jQuery(this).find('span[class^="bwg_nav_cont_"]').html(); jQuery(this).find('span[class^="bwg_nav_cont_"]').html(str); } }); } else { var str = jQuery(data).find('#' + form_id).html(); jQuery('#' + form_id).html(str); } // There are no images. if (jQuery("#bwg_search_input_" + current_view).length > 0 && album_gallery_id == 0) { // Search box exists and not album view. var bwg_images_count = jQuery('#bwg_images_count_' + current_view).val(); if (bwg_images_count == 0) { var cont = jQuery("#" + id).parent().html(); var error_msg = '

' + bwg_objectL10n.bwg_search_result + '

'; jQuery("#" + id).parent().html(error_msg + cont) } } }, beforeSend: function(){ }, complete:function(){ jQuery("div[id^='bwg_container1_'] img").each(function () { if (jQuery(this).attr("data-lazy-src") != '') { jQuery(this).attr("src", jQuery(this).attr("data-lazy-src")); } else if (jQuery(this).attr("data-src") != '') { jQuery(this).attr("src", jQuery(this).attr("data-src")); } }); jQuery(".blog_style_image_buttons_conteiner_" + current_view).find(jQuery(".bwg_blog_style_img_" + current_view)).on("load", function() { jQuery(".bwg_blog_style_img_" + current_view).closest(jQuery(".blog_style_image_buttons_conteiner_" + current_view)).show(); }); if ( id != "bwg_standart_thumbnails_" + current_view ) { jQuery("#ajax_loading_" + current_view).css('display', 'none'); //jQuery("#ajax_loading_" + current_view).addClass('bwg-hidden'); } jQuery("#bwg_tags_id_" + id).val(jQuery("#bwg_tag_id_" + id).val()); if (jQuery(".pagination-links_" + current_view).length) { jQuery("html, body").animate({scrollTop: jQuery('#' + form_id).offset().top - 150}, 500); } /* For thumbnails view.*/ if (id == "bwg_standart_thumbnails_" + current_view) { bwg_document_ready(); bwg_all_thumnails_loaded(".bwg-container-" + current_view); } else { window["bwg_document_ready_" + current_view](); } /* For masonry view.*/ if (id == "bwg_masonry_thumbnails_" + current_view || id == "bwg_album_masonry_" + current_view) { window["bwg_masonry_ajax_"+ current_view](masonry_loaded); } /* For mosaic view.*/ if (id == "bwg_mosaic_thumbnails_" + current_view) { window["bwg_mosaic_ajax_" + current_view](mosaic_loaded); } /* For Blog style view.*/ jQuery(".blog_style_images_conteiner_" + current_view + " .bwg_embed_frame_16x9_" + current_view).each(function (e) { jQuery(this).width(jQuery(this).parent().width()); jQuery(this).height(jQuery(this).width() * 0.5625); }); jQuery(".blog_style_images_conteiner_" + current_view + " .bwg_embed_frame_instapost_" + current_view).each(function (e) { jQuery(this).width(jQuery(this).parent().width()); /* 16 is 2*padding inside iframe */ /* 96 is 2*padding(top) + 1*padding(bottom) + 40(footer) + 32(header) */ jQuery(this).height((jQuery(this).width() - 16) * jQuery(this).attr('data-height') / jQuery(this).attr('data-width') + 96); }); /* For Image browser view.*/ jQuery('#bwg_embed_frame_16x9_' + current_view).width(jQuery('#bwg_embed_frame_16x9_' + current_view).parent().width()); jQuery('#bwg_embed_frame_16x9_' + current_view).height(jQuery('#bwg_embed_frame_16x9_' + current_view).width() * 0.5625); jQuery('#bwg_embed_frame_instapost_' + current_view).width(jQuery('#bwg_embed_frame_16x9_' + current_view).parent().width()); /* 16 is 2*padding inside iframe */ /* 96 is 2*padding(top) + 1*padding(bottom) + 40(footer) + 32(header) */ jQuery('.bwg_embed_frame_instapost_' + current_view).height((jQuery('.bwg_embed_frame_instapost_' + current_view).width() - 16) * jQuery('.bwg_embed_frame_instapost_' + current_view).attr('data-height') / jQuery('.bwg_embed_frame_instapost_' + current_view).attr('data-width') + 96); } }); return false; } function bwg_select_tag(current_view, form_id, cur_gal_id, album_gallery_id, type, reset) { if (reset) { jQuery("#bwg_tag_id_" + cur_gal_id).val(''); } spider_frontend_ajax(form_id, current_view, cur_gal_id, album_gallery_id, '', type, 1, ''); } function bwg_change_image(current_key, key, data, from_effect) { bwg = bwg_param['bwg']; bwg_current_key = bwg_param['bwg_current_key']; // var bwg_image_info_pos = jQuery(".bwg_ctrl_btn_container").height(); jQuery(".bwg_image_info").css("height","auto"); setTimeout(function(){ if(jQuery(".bwg_image_info_container1").height() < (jQuery(".bwg_image_info").height() + jQuery(".bwg_toggle_container").height() + bwg_image_info_pos + 2*(parseInt(bwg_param['lightbox_info_margin'])))) { if(bwg_param['lightbox_ctrl_btn_pos'] == 'top') { jQuery(".bwg_image_info").css("top",bwg_image_info_pos + "px"); } jQuery(".bwg_image_info").height(jQuery(".bwg_image_info_container1").height() - jQuery(".bwg_toggle_container").height() - bwg_image_info_pos - 2*(parseInt(bwg_param['lightbox_info_margin']))); } }, 200); jQuery("#spider_popup_left").show(); jQuery("#spider_popup_right").show(); jQuery(".bwg_image_info").hide(); if (bwg_param['enable_loop'] == 0) { if (key == (parseInt(data.length) - 1)) { jQuery("#spider_popup_right").hide(); } if (key == 0) { jQuery("#spider_popup_left").hide(); } } var ecommerceACtive = bwg_param['ecommerceACtive']; if( ecommerceACtive == 1 && bwg_param['enable_image_ecommerce'] == 1 ) { if( data[key]["pricelist"] == 0) { jQuery(".bwg_ecommerce").hide(); } else { jQuery(".bwg_ecommerce").show(); jQuery(".pge_tabs li").hide(); jQuery("#downloads").hide(); jQuery("#manual").hide(); var pricelistSections = data[key]["pricelist_sections"].split(","); if(pricelistSections){ jQuery("#" + pricelistSections[0]).show(); jQuery("[name=type]").val(pricelistSections[0]); if(pricelistSections.length > 1){ jQuery(".pge_tabs").show(); for( k=0 ; k key) { var direction = 'left'; } else if (bwg_current_key == key) { return; } /*jQuery("#spider_popup_left").hover().css({"display": "inline"}); jQuery("#spider_popup_right").hover().css({"display": "inline"});*/ jQuery(".bwg_image_count").html(data[key]["number"]); /* Set filmstrip initial position.*/ jQuery(".bwg_watermark").css({display: 'none'}); /* Set active thumbnail position.*/ if ( bwg_param['width_or_height'] == 'width' ) { bwg_current_filmstrip_pos = key * (jQuery(".bwg_filmstrip_thumbnail").width() + 2 + 2 * bwg_param['lightbox_filmstrip_thumb_border_width']); } else if ( bwg_param['width_or_height'] == 'height' ) { bwg_current_filmstrip_pos = key * (jQuery(".bwg_filmstrip_thumbnail").height() + 2 + 2 * bwg_param['lightbox_filmstrip_thumb_border_width']); } bwg_param['bwg_current_key'] = key; /* Change hash.*/ window.location.hash = "bwg"+bwg_param['gallery_id']+"/" + data[key]["id"]; /* Change image id for rating.*/ if (bwg_param['popup_enable_rate']) { jQuery("#bwg_rate_form input[name='image_id']").val(data[key]["id"]); jQuery("#bwg_star").attr("data-score", data[key]["avg_rating"]); jQuery("#bwg_star").removeAttr("title"); bwg_rating(data[key]["rate"], data[key]["rate_count"], data[key]["avg_rating"], key); } /* Increase image hit counter.*/ spider_set_input_value('rate_ajax_task', 'save_hit_count'); spider_rate_ajax_save('bwg_rate_form'); jQuery(".bwg_image_hits span").html(++data[key]["hit_count"]); /* Change image id.*/ jQuery("#bwg_popup_image").attr('image_id', data[key]["id"]); /* Change image title, description.*/ jQuery(".bwg_image_title").html(jQuery('').html(data[key]["alt"]).text()); jQuery(".bwg_image_description").html(jQuery('').html(data[key]["description"]).text()); /*jQuery(".bwg_image_info").removeAttr("style");*/ if (data[key]["alt"].trim() == "") { if (data[key]["description"].trim() == "") { jQuery(".bwg_image_info").css("background", "none"); } } if (jQuery(".bwg_image_info_container1").css("display") != 'none') { jQuery(".bwg_image_info_container1").css("display", "table-cell"); } else { jQuery(".bwg_image_info_container1").css("display", "none"); } /* Change image rating.*/ if (jQuery(".bwg_image_rate_container1").css("display") != 'none') { jQuery(".bwg_image_rate_container1").css("display", "table-cell"); } else { jQuery(".bwg_image_rate_container1").css("display", "none"); } var current_image_class = jQuery(".bwg_popup_image_spun").css("zIndex") == 2 ? ".bwg_popup_image_spun" : ".bwg_popup_image_second_spun"; var next_image_class = current_image_class == ".bwg_popup_image_second_spun" ? ".bwg_popup_image_spun" : ".bwg_popup_image_second_spun"; var is_embed = data[key]['filetype'].indexOf("EMBED_") > -1 ? true : false; var is_embed_instagram_post = data[key]['filetype'].indexOf('INSTAGRAM_POST') > -1 ? true : false; var is_embed_instagram_video = data[key]['filetype'].indexOf('INSTAGRAM_VIDEO') > -1 ? true : false; var cur_height = jQuery(current_image_class).height(); var cur_width = jQuery(current_image_class).width(); var innhtml = ''; if (!is_embed) { jQuery("#bwg_download").removeClass("hidden"); innhtml += '').html(data[key]["image_url"]).text() + '" alt="' + data[key]["alt"] + '" />'; } else { /*is_embed*/ /* hide download button if image source is embed */ jQuery("#bwg_download").addClass("hidden"); /*innhtml += '';*/ innhtml += '' + (is_embed_instagram_video ? '
' : ' '); if (is_embed_instagram_post) { var post_width = 0; var post_height = 0; if (cur_height < cur_width + 88) { post_height = cur_height; post_width = post_height - 88; } else { post_width = cur_width; post_height = post_width + 88; } innhtml += spider_display_embed(data[key]['filetype'], data[key]['image_url'], data[key]['filename'], {class:"bwg_embed_frame", 'data-width': data[key]['image_width'], 'data-height': data[key]['image_height'], frameborder: "0", allowfullscreen: "allowfullscreen", style: "width:" + post_width + "px; height:" + post_height + "px; vertical-align:middle; display:inline-block; position:relative;"}); } else { innhtml += spider_display_embed(data[key]['filetype'],data[key]['image_url'], data[key]['filename'], {class:"bwg_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"width:inherit; height:inherit; vertical-align:middle; display:block;" }); } innhtml += "
"; } innhtml += '
'; jQuery(next_image_class).html(innhtml); jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({ maxWidth: cur_width, maxHeight: cur_height, height: 'auto', }); function bwg_afterload() { if (bwg_param['preload_images']) { bwg_preload_images(key); } window['bwg_'+bwg_param['bwg_image_effect']](current_image_class, next_image_class, direction); jQuery(current_image_class).find('.bwg_fb_video').each(function () { jQuery(this).attr('src', ''); }); if (!is_embed) { jQuery("#bwg_fullsize_image").attr("href", bwg_param['site_url'] + data[key]['image_url']); jQuery("#bwg_download").attr("href", bwg_param['site_url'] + data[key]['thumb_url'].replace('/thumb/', '/.original/')); } else { jQuery("#bwg_fullsize_image").attr("href", data[key]['image_url']); } var image_arr = data[key]['image_url'].split("/"); jQuery("#bwg_download").attr("download", image_arr[image_arr.length - 1]); /* Change image social networks urls.*/ var bwg_share_url = encodeURIComponent(bwg_param['bwg_share_url']) + "=" + data[key]['id'] + encodeURIComponent('#bwg'+bwg_param['gallery_id']+'/') + data[key]['id']; if (is_embed) { var bwg_share_image_url = encodeURIComponent(data[key]['thumb_url']); } else { var bwg_share_image_url = bwg_param['bwg_share_image_url'] + encodeURIComponent(encodeURIComponent(data[key]['image_url'])); } bwg_share_image_url = bwg_share_image_url.replace(/%252F/g, '%2F'); if (typeof addthis_share != "undefined") { addthis_share.url = bwg_share_url; } jQuery("#bwg_facebook_a").attr("href", "https://www.facebook.com/sharer/sharer.php?u=" + bwg_share_url); jQuery("#bwg_twitter_a").attr("href", "https://twitter.com/share?url=" + bwg_share_url); jQuery("#bwg_google_a").attr("href", "https://plus.google.com/share?url=" + bwg_share_url); jQuery("#bwg_pinterest_a").attr("href", "http://pinterest.com/pin/create/button/?s=100&url=" + bwg_share_url + "&media=" + bwg_share_image_url + "&description=" + data[key]['alt'] + '%0A' + data[key]['description']); jQuery("#bwg_tumblr_a").attr("href", "https://www.tumblr.com/share/photo?source=" + bwg_share_image_url + "&caption=" + data[key]['alt'] + "&clickthru=" + bwg_share_url); /* Load comments.*/ if (jQuery(".bwg_comment_container").hasClass("bwg_open")) { if (data[key]["comment_count"] == 0) { jQuery("#bwg_added_comments").hide(); } else { jQuery("#bwg_added_comments").show(); spider_set_input_value('ajax_task', 'display'); spider_set_input_value('image_id', jQuery('#bwg_popup_image').attr('image_id')); spider_ajax_save('bwg_comment_form'); } } if (jQuery(".bwg_ecommerce_container").hasClass("bwg_open")) { /* Pricelist */ if(data[key]["pricelist"] == 0){ /* Close ecommerce.*/ bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container")); bwg_animate_image_box_for_hide_sidebar(); jQuery(".bwg_ecommerce_container").attr("class", "bwg_ecommerce_container bwg_close"); jQuery(".bwg_ecommerce").attr("title", bwg_objectsL10n.bwg_show_ecommerce); jQuery(".spider_popup_close_fullscreen").show(); } else{ get_ajax_pricelist(); } } /* Update custom scroll.*/ if (typeof jQuery().mCustomScrollbar !== 'undefined') { if (jQuery.isFunction(jQuery().mCustomScrollbar)) { jQuery(".bwg_comments").mCustomScrollbar({ advanced:{ updateOnContentResize: true } }); } } jQuery(".bwg_comments .mCSB_scrollTools").hide(); if (bwg_param['enable_image_filmstrip']) { bwg_move_filmstrip(); } bwg_resize_instagram_post(); } if (!is_embed) { var cur_img = jQuery(next_image_class).find('img'); cur_img.one('load', function() { bwg_afterload(); }).each(function() { if(this.complete) jQuery(this).load(); }); } else { bwg_afterload(); } } } } function bwg_preload_images( key ) { var count_all = data.length; var preloadCount = (bwg_param['preload_images_count'] == 0) ? data.length : (bwg_param['preload_images_count'] > data.length) ? data.length : bwg_param['preload_images_count']; var is_embed; var indexedImgCount = 0; var leftIndex, rightIndex; for ( var i = 1; i < count_all; i++ ) { leftIndex = key - i; rightIndex = key + i; if ( key == 0 ) { leftIndex = 0; rightIndex = 0; } /* Right from key indexes */ if ( rightIndex < count_all ) { /* check if right index is greater than max index */ is_embed = data[rightIndex]['filetype'].indexOf("EMBED_") > -1 ? true : false; if ( typeof data[rightIndex] != "undefined" ) { if ( !is_embed ) { jQuery("").attr("src", bwg_param['site_url'] + jQuery('').html(data[rightIndex]["image_url"]).text()); indexedImgCount++; if ( indexedImgCount >= preloadCount ) { break; } } } } /* Left from key indexes */ if ( leftIndex > 0 ) { is_embed = data[leftIndex]['filetype'].indexOf("EMBED_") > -1 ? true : false; if ( typeof data[leftIndex] != "undefined" ) { if ( !is_embed ) { jQuery("").attr("src", bwg_param['site_url'] + jQuery('').html(data[leftIndex]["image_url"]).text()); indexedImgCount++; if ( indexedImgCount >= preloadCount ) { break; } } } } } } function bwg_cube(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_image_class, direction) { /* If browser does not support 3d transforms/CSS transitions.*/ if (!bwg_testBrowser_cssTransitions()) { return bwg_fallback(current_image_class, next_image_class, direction); } if (!bwg_testBrowser_cssTransforms3d()) { return bwg_fallback3d(current_image_class, next_image_class, direction); } bwg_trans_in_progress = true; /* Set active thumbnail.*/ jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"); jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active"); jQuery(".bwg_slide_bg").css('perspective', 1000); jQuery(current_image_class).css({ transform : 'translateZ(' + tz + 'px)', backfaceVisibility : 'hidden' }); jQuery(next_image_class).css({ opacity : 1, filter: 'Alpha(opacity=100)', backfaceVisibility : 'hidden', transform : 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY('+ nry +'deg) rotateX('+ nrx +'deg)' }); jQuery(".bwg_slider").css({ transform: 'translateZ(-' + tz + 'px)', transformStyle: 'preserve-3d' }); /* Execution steps.*/ setTimeout(function () { jQuery(".bwg_slider").css({ transition: 'all ' + bwg_transition_duration + 'ms ease-in-out', transform: 'translateZ(-' + tz + 'px) rotateX('+ wrx +'deg) rotateY('+ wry +'deg)' }); }, 20); /* After transition.*/ jQuery(".bwg_slider").one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(bwg_after_trans)); function bwg_after_trans() { jQuery(current_image_class).removeAttr('style'); jQuery(next_image_class).removeAttr('style'); jQuery(".bwg_slider").removeAttr('style'); jQuery(current_image_class).css({'opacity' : 0, filter: 'Alpha(opacity=0)', 'z-index': 1}); jQuery(next_image_class).css({'opacity' : 1, filter: 'Alpha(opacity=100)', 'z-index' : 2}); jQuery(".bwg_image_info").show(); bwg_trans_in_progress = false; jQuery(current_image_class).html(''); if (typeof event_stack !== 'undefined') { if (event_stack.length > 0) { key = event_stack[0].split("-"); event_stack.shift(); bwg_change_image(key[0], key[1], data, true); } } bwg_change_watermark_container(); } if (bwg_transition_duration == 0) { bwg_after_trans(); } } /* For browsers that does not support transitions.*/ function bwg_fallback(current_image_class, next_image_class, direction, bwg) { bwg_fade(current_image_class, next_image_class, direction); } function bwg_none(current_image_class, next_image_class, direction, bwg) { jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1}); jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2}); jQuery(".bwg_image_info").show(); /* Set active thumbnail.*/ jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"); jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active"); bwg_trans_in_progress = false; jQuery(current_image_class).html(''); bwg_change_watermark_container(); } function bwg_fade(current_image_class, next_image_class, direction, bwg) { /* Set active thumbnail.*/ jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"); jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active"); function bwg_after_trans() { jQuery(".bwg_image_info").show(); bwg_change_watermark_container(); } if (bwg_testBrowser_cssTransitions()) { jQuery(next_image_class).css('transition', 'opacity ' + bwg_transition_duration + 'ms linear'); jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1}); jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2}); jQuery(next_image_class).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(bwg_after_trans)); } else { jQuery(current_image_class).animate({'opacity' : 0, 'z-index' : 1}, bwg_transition_duration); jQuery(next_image_class).animate({ 'opacity' : 1, 'z-index': 2 }, { duration: bwg_transition_duration, complete: function () { bwg_trans_in_progress = false; jQuery(current_image_class).html(''); bwg_after_trans() } }); /* For IE.*/ jQuery(current_image_class).fadeTo(bwg_transition_duration, 0); jQuery(next_image_class).fadeTo(bwg_transition_duration, 1); } if (bwg_transition_duration == 0) { bwg_after_trans(); } } function bwg_testBrowser_cssTransitions() { return bwg_testDom('Transition'); } function bwg_testBrowser_cssTransforms3d() { return bwg_testDom('Perspective'); } function bwg_testDom(prop) { /* Browser vendor CSS prefixes.*/ var browserVendors = ['', '-webkit-', '-moz-', '-ms-', '-o-', '-khtml-']; /* Browser vendor DOM prefixes.*/ var domPrefixes = ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml']; var i = domPrefixes.length; while (i--) { if (typeof document.body.style[domPrefixes[i] + prop] !== 'undefined') { return true; } } return false; } function bwg_change_watermark_container() { jQuery(".bwg_slider").children().each(function() { if (jQuery(this).css("zIndex") == 2) { /* This may be neither img nor iframe.*/ var bwg_current_image_span = jQuery(this).find("img"); if (!bwg_current_image_span.length) { bwg_current_image_span = jQuery(this).find("iframe"); } if (!bwg_current_image_span.length) { bwg_current_image_span = jQuery(this).find("video"); } /*set timeout for video to get size according to style, and then put watermark*/ setTimeout(function () { var width = bwg_current_image_span.width(); var height = bwg_current_image_span.height(); jQuery(".bwg_watermark_spun").width(width); jQuery(".bwg_watermark_spun").height(height); jQuery(".bwg_watermark").css({display: ''}); /* Set watermark image size.*/ var comment_container_width = 0; if (jQuery(".bwg_comment_container").hasClass("bwg_open") || jQuery(".bwg_ecommerce_container").hasClass("bwg_open") ) { comment_container_width = bwg_param['lightbox_comment_width']; } if (width <= (jQuery(window).width() - comment_container_width)) { jQuery(".bwg_watermark_image").css({ width: ((jQuery(".spider_popup_wrap").width() - comment_container_width) * bwg_param['watermark_font_size'] / bwg_param['image_width']) }); jQuery(".bwg_watermark_text, .bwg_watermark_text:hover").css({ fontSize: ((jQuery(".spider_popup_wrap").width() - comment_container_width) * bwg_param['watermark_font_size'] / bwg_param['image_width']) }); } }, 100); } }); } function bwg_set_filmstrip_pos(filmStripWidth) { if ( bwg_param['outerWidth_or_outerHeight'] == 'outerWidth' ) { var selectedImagePos = -bwg_current_filmstrip_pos - (jQuery(".bwg_filmstrip_thumbnail").outerWidth(true)) / 2; } else if ( bwg_param['outerWidth_or_outerHeight'] == 'outerHeight' ) { var selectedImagePos = -bwg_current_filmstrip_pos - (jQuery(".bwg_filmstrip_thumbnail").outerHeight(true)) / 2; } if ( bwg_param['width_or_height'] == 'width' ) { var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".bwg_filmstrip_thumbnails").width(), selectedImagePos + filmStripWidth / 2)); } else if (bwg_param['width_or_height'] == 'height') { var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".bwg_filmstrip_thumbnails").height(), selectedImagePos + filmStripWidth / 2)); } if ( bwg_param['left_or_top'] == 'left' ) { jQuery(".bwg_filmstrip_thumbnails").animate({ left: imagesContainerLeft }, { duration: 500, complete: function () { bwg_filmstrip_arrows(); } }); } else if ( bwg_param['left_or_top'] == 'top' ) { jQuery(".bwg_filmstrip_thumbnails").animate({ top: imagesContainerLeft }, { duration: 500, complete: function () { bwg_filmstrip_arrows(); } }); } } // open popup sidebar function bwg_popup_sidebar_open(obj){ var comment_container_width = bwg_param['lightbox_comment_width']; var lightbox_comment_pos = bwg_param['lightbox_comment_pos']; if (comment_container_width > jQuery(window).width()) { comment_container_width = jQuery(window).width(); obj.css({ width: comment_container_width, }); jQuery(".spider_popup_close_fullscreen").hide(); jQuery(".spider_popup_close").hide(); if (jQuery(".bwg_ctrl_btn").hasClass("fa-pause")) { var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); jQuery(".bwg_play_pause").trigger(isMobile ? 'touchend' : 'click'); } } else { jQuery(".spider_popup_close_fullscreen").show(); } //obj.animate({lightbox_comment_pos; ?>: 0}, 100); if(lightbox_comment_pos == 'left') { obj.animate({left: 0}, 100); } else { obj.animate({right: 0}, 100); } } function bwg_popup_sidebar_close(obj){ var border_width = parseInt(obj.css('borderRightWidth')); if (!border_width) { border_width = 0; } if( lightbox_comment_pos == 'left' ) { obj.animate({left: -obj.width() - border_width}, 100); } else if ( lightbox_comment_pos == 'right' ) { obj.animate({right: -obj.width() - border_width}, 100); } } function bwg_animate_image_box_for_hide_sidebar(){ if( lightbox_comment_pos == 'left' ) { jQuery(".bwg_image_wrap").animate({ left: 0, width: jQuery("#spider_popup_wrap").width() }, 100); } else if ( lightbox_comment_pos == 'right' ) { jQuery(".bwg_image_wrap").animate({ right: 0, width: jQuery("#spider_popup_wrap").width() }, 100); } jQuery(".bwg_image_container").animate({ width: jQuery("#spider_popup_wrap").width() - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0)}, 100); jQuery(".bwg_popup_image").animate({ maxWidth: jQuery("#spider_popup_wrap").width() - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0) }, { duration: 100, complete: function () { bwg_change_watermark_container(); } }); jQuery(".bwg_popup_embed").animate({ width: jQuery("#spider_popup_wrap").width() - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0) }, { duration: 100, complete: function () { bwg_resize_instagram_post(); bwg_change_watermark_container(); } }); if ( bwg_param['width_or_height'] == 'width' ) { jQuery(".bwg_filmstrip_container").animate({width: jQuery(".spider_popup_wrap").width()}, 100); jQuery(".bwg_filmstrip").animate({width: jQuery(".spider_popup_wrap").width() - 40}, 100); } else if ( bwg_param['width_or_height'] == 'height' ) { jQuery(".bwg_filmstrip_container").animate({height: jQuery(".spider_popup_wrap").width()}, 100); jQuery(".bwg_filmstrip").animate({height: jQuery(".spider_popup_wrap").width() - 40}, 100); } /* Set filmstrip initial position.*/ bwg_set_filmstrip_pos(jQuery(".spider_popup_wrap").width() - 40); jQuery(".spider_popup_close_fullscreen").show(100); } function bwg_animate_image_box_for_show_sidebar() { var bwg_comment_container = jQuery(".bwg_comment_container").width() || jQuery(".bwg_ecommerce_container").width(); if(lightbox_comment_pos == 'left') { jQuery(".bwg_image_wrap").animate({ left: bwg_comment_container, width: jQuery("#spider_popup_wrap").width() - bwg_comment_container }, 100); } else if(lightbox_comment_pos == 'right') { jQuery(".bwg_image_wrap").animate({ right: bwg_comment_container, width: jQuery("#spider_popup_wrap").width() - bwg_comment_container }, 100); } jQuery(".bwg_image_container").animate({ width: jQuery("#spider_popup_wrap").width() - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0) - bwg_comment_container }, 100); jQuery(".bwg_popup_image").animate({ maxWidth: jQuery("#spider_popup_wrap").width() - bwg_comment_container - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0) }, { duration: 100, complete: function () { bwg_change_watermark_container(); } }); jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").animate({ maxWidth: jQuery("#spider_popup_wrap").width() - bwg_comment_container - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0) }, { duration: 100, complete: function () { bwg_resize_instagram_post(); bwg_change_watermark_container(); } }); if (bwg_param['width_or_height'] == 'width') { jQuery(".bwg_filmstrip_container").css({width: jQuery("#spider_popup_wrap").width() - (bwg_param['filmstrip_direction'] == 'vertical' ? 0 : 'bwg_comment_container')}); jQuery(".bwg_filmstrip").animate({width: jQuery(".bwg_filmstrip_container").width() - 40}, 100); /* Set filmstrip initial position.*/ bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip_container").width() - 40); } } /* Open/close comments.*/ function bwg_comment() { jQuery(".bwg_watermark").css({display: 'none'}); jQuery(".bwg_ecommerce_wrap").css("z-index","-1"); jQuery(".bwg_comment_wrap").css("z-index","25"); if(jQuery(".bwg_ecommerce_container").hasClass("bwg_open") ){ bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container")); jQuery(".bwg_ecommerce_container").attr("class", "bwg_ecommerce_container bwg_close"); jQuery(".bwg_ecommerce").attr("title", bwg_objectsL10n.bwg_show_ecommerce); } if (jQuery(".bwg_comment_container").hasClass("bwg_open") ) { /* Close comment.*/ bwg_popup_sidebar_close(jQuery(".bwg_comment_container")); bwg_animate_image_box_for_hide_sidebar(); jQuery(".bwg_comment_wrap").css("z-index","-1"); jQuery(".bwg_comment_container").attr("class", "bwg_comment_container bwg_close"); jQuery(".bwg_comment").attr("title", bwg_objectsL10n.bwg_show_comments); jQuery(".spider_popup_close_fullscreen").show(); } else { /* Open comment.*/ bwg_popup_sidebar_open(jQuery(".bwg_comment_container")); bwg_animate_image_box_for_show_sidebar(); jQuery(".bwg_comment_container").attr("class", "bwg_comment_container bwg_open"); jQuery(".bwg_comment").attr("title", bwg_objectsL10n.bwg_hide_comments); /* Load comments.*/ var cur_image_key = parseInt(jQuery("#bwg_current_image_key").val()); if (data[cur_image_key]["comment_count"] != 0) { jQuery("#bwg_added_comments").show(); spider_set_input_value('ajax_task', 'display'); spider_set_input_value('image_id', jQuery('#bwg_popup_image').attr('image_id')); spider_ajax_save('bwg_comment_form'); } } } /* Open/close ecommerce.*/ function bwg_ecommerce() { jQuery(".bwg_watermark").css({display: 'none'}); jQuery(".bwg_ecommerce_wrap").css("z-index","25"); jQuery(".bwg_comment_wrap").css("z-index","-1"); if (jQuery(".bwg_comment_container").hasClass("bwg_open")) { bwg_popup_sidebar_close(jQuery(".bwg_comment_container")); jQuery(".bwg_comment_container").attr("class", "bwg_comment_container bwg_close"); // Must be translatable jQuery(".bwg_comment").attr("title", bwg_objectsL10n.bwg_how_comments); } if (jQuery(".bwg_ecommerce_container").hasClass("bwg_open")) { /* Close ecommerce.*/ bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container")); bwg_animate_image_box_for_hide_sidebar(); jQuery(".bwg_ecommerce_container").attr("class", "bwg_ecommerce_container bwg_close"); // Must be translatable jQuery(".bwg_ecommerce").attr("title", bwg_objectsL10n.bwg_show_ecommerce); // jQuery(".spider_popup_close_fullscreen").show(); } else { /* Open ecommerce.*/ bwg_popup_sidebar_open(jQuery(".bwg_ecommerce_container")); bwg_animate_image_box_for_show_sidebar(); jQuery(".bwg_ecommerce_container").attr("class", "bwg_ecommerce_container bwg_open"); jQuery(".bwg_ecommerce").attr("title", bwg_objectsL10n.bwg_hide_ecommerce); get_ajax_pricelist(); } } function bwg_reset_zoom() { var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); var viewportmeta = document.querySelector('meta[name="viewport"]'); if (isMobile) { if (viewportmeta) { viewportmeta.content = 'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=0'; } } } function bwg_move_filmstrip() { var image_right = (bwg_param['left_or_top'] == 'left' ? jQuery(".bwg_thumb_active").position().left : jQuery(".bwg_thumb_active").position().top) + (bwg_param['outerWidth_or_outerHeight'] == 'outerWidth' ? jQuery(".bwg_thumb_active").outerWidth(true) : jQuery(".bwg_thumb_active").outerHeight(true)); var bwg_filmstrip_width = (bwg_param['outerWidth_or_outerHeight'] == 'outerWidth' ? jQuery(".bwg_filmstrip").outerWidth(true) : jQuery(".bwg_filmstrip").outerHeight(true)); var bwg_filmstrip_thumbnails_width = (bwg_param['outerWidth_or_outerHeight'] == 'outerWidth' ? jQuery(".bwg_filmstrip_thumbnails").outerWidth(true) : jQuery(".bwg_filmstrip_thumbnails").outerHeight(true)); if ( bwg_param['left_or_top'] == 'left' ) { var image_left = jQuery(".bwg_thumb_active").position().left; var long_filmstrip_cont_left = jQuery(".bwg_filmstrip_thumbnails").position().left; var long_filmstrip_cont_right = Math.abs(jQuery(".bwg_filmstrip_thumbnails").position().left) + bwg_filmstrip_width; } else if ( bwg_param['left_or_top'] == 'top' ) { var image_left = jQuery(".bwg_thumb_active").position().top; var long_filmstrip_cont_left = jQuery(".bwg_filmstrip_thumbnails").position().top; var long_filmstrip_cont_right = Math.abs(jQuery(".bwg_filmstrip_thumbnails").position().top) + bwg_filmstrip_width; } if (bwg_filmstrip_width > bwg_filmstrip_thumbnails_width) { return; } if (image_left < Math.abs(long_filmstrip_cont_left)) { if ( bwg_param['left_or_top'] == 'left' ) { jQuery(".bwg_filmstrip_thumbnails").animate({ left: -image_left }, { duration: 500, complete: function () { bwg_filmstrip_arrows(); } }); } else { jQuery(".bwg_filmstrip_thumbnails").animate({ top: -image_left }, { duration: 500, complete: function () { bwg_filmstrip_arrows(); } }); } } else if (image_right > long_filmstrip_cont_right) { if ( bwg_param['left_or_top'] == 'left' ) { jQuery(".bwg_filmstrip_thumbnails").animate({ left: -(image_right - bwg_filmstrip_width) }, { duration: 500, complete: function () { bwg_filmstrip_arrows(); } }); } else { jQuery(".bwg_filmstrip_thumbnails").animate({ top: -(image_right - bwg_filmstrip_width) }, { duration: 500, complete: function () { bwg_filmstrip_arrows(); } }); } } } /* Show/hide filmstrip arrows.*/ function bwg_filmstrip_arrows() { if ( bwg_param['width_or_height'] == 'width' ){ var condition1 = jQuery(".bwg_filmstrip_thumbnails").width(); var condition2 = jQuery(".bwg_filmstrip").width() } else { var condition1 = jQuery(".bwg_filmstrip_thumbnails").height(); var condition2 = jQuery(".bwg_filmstrip").height() } if (condition1 < condition2) { jQuery(".bwg_filmstrip_left").hide(); jQuery(".bwg_filmstrip_right").hide(); } else { jQuery(".bwg_filmstrip_left").show(); jQuery(".bwg_filmstrip_right").show(); } } /* Open with fullscreen.*/ function bwg_open_with_fullscreen() { jQuery(".bwg_watermark").css({display: 'none'}); var comment_container_width = 0; if (jQuery(".bwg_comment_container").hasClass("bwg_open") || jQuery(".bwg_ecommerce_container").hasClass("bwg_open")) { comment_container_width = jQuery(".bwg_comment_container").width() || jQuery(".bwg_ecommerce_container").width(); } bwg_popup_current_width = jQuery(window).width(); bwg_popup_current_height = jQuery(window).height(); jQuery("#spider_popup_wrap").css({ width: jQuery(window).width(), height: jQuery(window).height(), left: 0, top: 0, margin: 0, zIndex: 100000 }); jQuery(".bwg_image_wrap").css({width: (jQuery(window).width() - comment_container_width)}); jQuery(".bwg_image_container").css({height: (bwg_popup_current_height - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0)), width: bwg_popup_current_width - comment_container_width - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0)}); jQuery(".bwg_popup_image").css({ maxWidth: jQuery(window).width() - comment_container_width - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0), maxHeight: jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0) }, { complete: function () { bwg_change_watermark_container(); } }); jQuery(".bwg_popup_video").css({ width: jQuery(window).width() - comment_container_width - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0), height: jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0) }, { complete: function () { bwg_change_watermark_container(); } }); jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({ maxWidth: jQuery(window).width() - comment_container_width - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0), maxHeight: jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0) }, { complete: function () { bwg_resize_instagram_post(); bwg_change_watermark_container(); } }); if ( bwg_param['width_or_height'] == 'width' ) { jQuery(".bwg_filmstrip_container").css({width: jQuery(window).width() - (bwg_param['filmstrip_direction'] == 'horizontal' ? 'comment_container_width' : 0)}); jQuery(".bwg_filmstrip").css({width: jQuery(window).width() - (bwg_param['filmstrip_direction'] == 'horizontal' ? 'comment_container_width' : 0) - 40}); /* Set filmstrip initial position.*/ bwg_set_filmstrip_pos(jQuery(window).width() - (bwg_param['filmstrip_direction'] == 'horizontal' ? 'comment_container_width' : 0) - 40); } else { jQuery(".bwg_filmstrip_container").css({height: jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? 'comment_container_width' : 0)}); jQuery(".bwg_filmstrip").css({height: jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? 'comment_container_width' : 0) - 40}); /* Set filmstrip initial position.*/ bwg_set_filmstrip_pos(jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? 'comment_container_width' : 0) - 40); } jQuery(".bwg_resize-full").attr("class", "bwg_ctrl_btn bwg_resize-full fa fa-resize-small"); jQuery(".bwg_resize-full").attr("title", bwg_objectsL10n.bwg_restore); jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen"); } function bwg_resize_instagram_post() { if (jQuery('.inner_instagram_iframe_bwg_embed_frame').length) { var post_width = jQuery(".bwg_image_container").width(); var post_height = jQuery(".bwg_image_container").height(); var FeedbackSocialProofHeight = 132; jQuery('.inner_instagram_iframe_bwg_embed_frame').each(function() { var parent_container = jQuery(this).parent(); if (post_height / (parseInt(parent_container.attr('data-height')) + FeedbackSocialProofHeight) < post_width / parseInt(parent_container.attr('data-width'))) { parent_container.height(post_height); parent_container.width((parent_container.height() - FeedbackSocialProofHeight) * parent_container.attr('data-width') / parent_container.attr('data-height') + 16); } else { parent_container.width(post_width); parent_container.height((parent_container.width() - 16) * parent_container.attr('data-height') / parent_container.attr('data-width') + 96); } parent_container.css({top: 0.5 * (post_height - parent_container.height())}); }); bwg_change_watermark_container(); } } function bwg_play() { window.clearInterval(bwg_playInterval); bwg_playInterval = setInterval(function () { if (!data[parseInt(jQuery('#bwg_current_image_key').val()) + 1]) { if (bwg_param['enable_loop'] == 1) { /* Wrap around.*/ bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), 0, data); } return; } bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), parseInt(jQuery('#bwg_current_image_key').val()) + 1, data) }, bwg_param['slideshow_interval'] * 1000); } function bwg_resize_full() { jQuery(".bwg_watermark").css({display: 'none'}); var comment_container_width = 0; if (jQuery(".bwg_comment_container").hasClass("bwg_open") || jQuery(".bwg_ecommerce_container").hasClass("bwg_open") ) { comment_container_width = jQuery(".bwg_comment_container").width() || jQuery(".bwg_ecommerce_container").width(); } // resize to small from full if (jQuery(".bwg_resize-full").hasClass("fa-resize-small")) { if (jQuery(window).width() > bwg_param['image_width']) { bwg_popup_current_width = bwg_param['image_width']; } if (jQuery(window).height() > bwg_param['image_height']) { bwg_popup_current_height = bwg_param['image_height']; } /* Minimize.*/ jQuery("#spider_popup_wrap").animate({ width: bwg_popup_current_width, height: bwg_popup_current_height, left: '50%', top: '50%', marginLeft: -bwg_popup_current_width / 2, marginTop: -bwg_popup_current_height / 2, zIndex: 100000 }, 500); jQuery(".bwg_image_wrap").animate({width: bwg_popup_current_width - comment_container_width}, 500); jQuery(".bwg_image_container").animate({height: bwg_popup_current_height - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0), width: bwg_popup_current_width - comment_container_width - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0)}, 500); jQuery(".bwg_popup_image").animate({ maxWidth: bwg_popup_current_width - comment_container_width - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0), maxHeight: bwg_popup_current_height - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0) }, { duration: 500, complete: function () { bwg_change_watermark_container(); if ((jQuery("#spider_popup_wrap").width() < jQuery(window).width())) { if (jQuery("#spider_popup_wrap").height() < jQuery(window).height()) { jQuery(".spider_popup_close_fullscreen").attr("class", "spider_popup_close"); } } } }); jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").animate({ maxWidth: bwg_popup_current_width - comment_container_width - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0), maxHeight: bwg_popup_current_height - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0) }, { duration: 500, complete: function () { bwg_resize_instagram_post(); bwg_change_watermark_container(); if (jQuery("#spider_popup_wrap").width() < jQuery(window).width()) { if (jQuery("#spider_popup_wrap").height() < jQuery(window).height()) { jQuery(".spider_popup_close_fullscreen").attr("class", "spider_popup_close"); } } } }); if ( bwg_param['width_or_height'] == 'width' ) { jQuery(".bwg_filmstrip_container").animate({width: bwg_popup_current_width - (bwg_param['filmstrip_direction'] == 'horizontal' ? comment_container_width : 0)}, 500); jQuery(".bwg_filmstrip").animate({width: bwg_popup_current_width - (bwg_param['filmstrip_direction'] == 'horizontal' ? comment_container_width : 0) - 40}, 500); /* Set filmstrip initial position.*/ bwg_set_filmstrip_pos(bwg_popup_current_width - 40); } else { jQuery(".bwg_filmstrip_container").animate({height: bwg_popup_current_height - (bwg_param['filmstrip_direction'] == 'horizontal' ? comment_container_width : 0)}, 500); jQuery(".bwg_filmstrip").animate({height: bwg_popup_current_height - (bwg_param['filmstrip_direction'] == 'horizontal' ? comment_container_width : 0) - 40}, 500); /* Set filmstrip initial position.*/ bwg_set_filmstrip_pos(bwg_popup_current_height - 40); } jQuery(".bwg_resize-full").attr("class", "bwg_ctrl_btn bwg_resize-full fa fa-resize-full"); jQuery(".bwg_resize-full").attr("title", "prefix); ?>"); } else { // resize to full from small bwg_popup_current_width = jQuery(window).width(); bwg_popup_current_height = jQuery(window).height(); /* Maximize.*/ jQuery("#spider_popup_wrap").animate({ width: jQuery(window).width(), height: jQuery(window).height(), left: 0, top: 0, margin: 0, zIndex: 100000 }, 500); jQuery(".bwg_image_wrap").animate({width: (jQuery(window).width() - comment_container_width)}, 500); jQuery(".bwg_image_container").animate({height: (bwg_popup_current_height - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0)), width: bwg_popup_current_width - comment_container_width - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0)}, 500); jQuery(".bwg_popup_image").animate({ maxWidth: jQuery(window).width() - comment_container_width - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0), maxHeight: jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0) }, { duration: 500, complete: function () { bwg_change_watermark_container(); } }); jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").animate({ maxWidth: jQuery(window).width() - comment_container_width - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0), maxHeight: jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0) }, { duration: 500, complete: function () { bwg_resize_instagram_post(); bwg_change_watermark_container(); } }); if ( bwg_param['width_or_height'] == 'width' ) { jQuery(".bwg_filmstrip_container").animate({width: jQuery(window).width() - (bwg_param['filmstrip_direction'] == 'horizontal' ? comment_container_width : 0)}, 500); jQuery(".bwg_filmstrip").animate({width: jQuery(window).width() - (bwg_param['filmstrip_direction'] == 'horizontal' ? comment_container_width : 0) - 40}, 500); /* Set filmstrip initial position.*/ bwg_set_filmstrip_pos(jQuery(window).width() - (bwg_param['filmstrip_direction'] == 'horizontal' ? comment_container_width : 0) - 40); } else { jQuery(".bwg_filmstrip_container").animate({height: jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? comment_container_width : 0)}, 500); jQuery(".bwg_filmstrip").animate({height: jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? comment_container_width : 0) - 40}, 500); /* Set filmstrip initial position.*/ bwg_set_filmstrip_pos(jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? comment_container_width : 0) - 40); } jQuery(".bwg_resize-full").attr("class", "bwg_ctrl_btn bwg_resize-full fa fa-resize-small"); jQuery(".bwg_resize-full").attr("title", "prefix); ?>"); jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen"); } } function bwg_popup_resize() { if (typeof jQuery().fullscreen !== 'undefined') { if (jQuery.isFunction(jQuery().fullscreen)) { if (!jQuery.fullscreen.isFullScreen()) { jQuery(".bwg_resize-full").show(); if(!jQuery('.bwg_resize-full').hasClass('fa-resize-small')) { jQuery(".bwg_resize-full").attr("class", "bwg_ctrl_btn bwg_resize-full fa fa-resize-full"); } jQuery(".bwg_resize-full").attr("title", bwg_objectsL10n.bwg_maximize); jQuery(".bwg_fullscreen").attr("class", "bwg_ctrl_btn bwg_fullscreen fa fa-fullscreen"); jQuery(".bwg_fullscreen").attr("title", bwg_objectsL10n.fulscreen); } } } var comment_container_width = 0; if (jQuery(".bwg_comment_container").hasClass("bwg_open") || jQuery(".bwg_ecommerce_container").hasClass("bwg_open")) { comment_container_width = bwg_param['lightbox_comment_width']; } if (comment_container_width > jQuery(window).width()) { comment_container_width = jQuery(window).width(); jQuery(".bwg_comment_container").css({ width: comment_container_width }); jQuery(".bwg_ecommerce_container").css({ width: comment_container_width }); jQuery(".spider_popup_close_fullscreen").hide(); } else { jQuery(".spider_popup_close_fullscreen").show(); } if (!(!(jQuery(window).height() > bwg_param['image_height']) || !(bwg_param['open_with_fullscreen'] != 1)) && !jQuery('.bwg_resize-full').hasClass('fa-resize-small')) { jQuery("#spider_popup_wrap").css({ height: bwg_param['image_height'], top: '50%', marginTop: -bwg_param['image_height'] / 2, zIndex: 100000 }); jQuery(".bwg_image_container").css({height: (bwg_param['image_height'] - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0))}); jQuery(".bwg_popup_image").css({ maxHeight: bwg_param['image_height'] - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0) }); jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({ maxHeight: bwg_param['image_height'] - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0) }); if (bwg_param['filmstrip_direction'] == 'vertical') { jQuery(".bwg_filmstrip_container").css({height: bwg_param['image_height']}); jQuery(".bwg_filmstrip").css({height: (bwg_param['image_height'] - 40)}) } bwg_popup_current_height = bwg_param['image_height']; } else { jQuery("#spider_popup_wrap").css({ height: jQuery(window).height(), top: 0, marginTop: 0, zIndex: 100000 }); jQuery(".bwg_image_container").css({height: (jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0))}); jQuery(".bwg_popup_image").css({ maxHeight: jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0) }); jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({ maxHeight: jQuery(window).height() - (bwg_param['filmstrip_direction'] == 'horizontal' ? bwg_param['image_filmstrip_height'] : 0) }); if (bwg_param['filmstrip_direction'] == 'vertical') { jQuery(".bwg_filmstrip_container").css({height: (jQuery(window).height())}); jQuery(".bwg_filmstrip").css({height: (jQuery(window).height() - 40)}); } bwg_popup_current_height = jQuery(window).height(); } if (!(!(jQuery(window).width() >= bwg_param['image_width']) || !(bwg_param['open_with_fullscreen'] != 1))) { jQuery("#spider_popup_wrap").css({ width: bwg_param['image_width'], left: '50%', marginLeft: -bwg_param['image_width'] / 2, zIndex: 100000 }); jQuery(".bwg_image_wrap").css({width: bwg_param['image_width'] - comment_container_width}); jQuery(".bwg_image_container").css({width: (bwg_param['image_width'] - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0) - comment_container_width)}); jQuery(".bwg_popup_image").css({ maxWidth: bwg_param['image_width'] - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0) - comment_container_width }); jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({ maxWidth: bwg_param['image_width'] - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0) - comment_container_width }); if (bwg_param['filmstrip_direction'] == 'horizontal') { jQuery(".bwg_filmstrip_container").css({width: bwg_param['image_width'] - comment_container_width}); jQuery(".bwg_filmstrip").css({width: (bwg_param['image_width'] - comment_container_width- 40)}); } bwg_popup_current_width = bwg_param['image_width']; } else { jQuery("#spider_popup_wrap").css({ width: jQuery(window).width(), left: 0, marginLeft: 0, zIndex: 100000 }); jQuery(".bwg_image_wrap").css({width: (jQuery(window).width() - comment_container_width)}); jQuery(".bwg_image_container").css({width: (jQuery(window).width() - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0) - comment_container_width)}); jQuery(".bwg_popup_image").css({ maxWidth: jQuery(window).width() - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0) - comment_container_width }); jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({ maxWidth: jQuery(window).width() - (bwg_param['filmstrip_direction'] == 'vertical' ? bwg_param['image_filmstrip_width'] : 0) - comment_container_width }); if (bwg_param['filmstrip_direction'] == 'horizontal') { jQuery(".bwg_filmstrip_container").css({width: (jQuery(window).width() - comment_container_width)}); jQuery(".bwg_filmstrip").css({width: (jQuery(window).width() - comment_container_width - 40)}); } bwg_popup_current_width = jQuery(window).width(); } /* Set watermark container size.*/ bwg_resize_instagram_post(); bwg_change_watermark_container(); if (!(!(jQuery(window).height() > bwg_param['image_height'] - 2 * bwg_param['lightbox_close_btn_top']) || !(jQuery(window).width() >= bwg_param['image_width'] - 2 * bwg_param['lightbox_close_btn_right']) || !(bwg_param['open_with_fullscreen'] != 1))) { jQuery(".spider_popup_close_fullscreen").attr("class", "spider_popup_close"); } else { if (!(!(jQuery("#spider_popup_wrap").width() < jQuery(window).width()) || !(jQuery("#spider_popup_wrap").height() < jQuery(window).height()))) { jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen"); } } if ( bwg_param['lightbox_ctrl_btn_pos'] == 'bottom' ) { if (jQuery(".bwg_toggle_container i").hasClass('fa-angle-down')) { jQuery(".bwg_toggle_container").css("bottom", jQuery(".bwg_ctrl_btn_container").height() + "px"); } } if ( bwg_param['lightbox_ctrl_btn_pos'] == 'top') { if (jQuery(".bwg_toggle_container i").hasClass('fa-angle-up')) { jQuery(".bwg_toggle_container").css("top", jQuery(".bwg_ctrl_btn_container").height() + "px"); } } }; // source --> https://www.caroana.com.br/wp-content/plugins/photo-gallery/js/jquery.sumoselect.min.js?ver=3.0.2 /*! * jquery.sumoselect - v3.0.2 * http://hemantnegi.github.io/jquery.sumoselect */ !function(e){"namespace sumo";e.fn.SumoSelect=function(t){var l=e.extend({placeholder:"Select Here",csvDispCount:3,captionFormat:"{0} Selected",captionFormatAllSelected:"{0} all selected!",floatWidth:400,forceCustomRendering:!1,nativeOnDevice:["Android","BlackBerry","iPhone","iPad","iPod","Opera Mini","IEMobile","Silk"],outputAsCSV:!1,csvSepChar:",",okCancelInMulti:!1,triggerChangeCombined:!0,selectAll:!1,search:!1,searchText:"Search...",noMatch:'No matches for "{0}"',prefix:"",locale:["OK","Cancel","Select All"],up:!1},t),s=this.each(function(){var t=this;!this.sumo&&e(this).is("select")&&(this.sumo={E:e(t),is_multi:e(t).attr("multiple"),select:"",caption:"",placeholder:"",optDiv:"",CaptionCont:"",ul:"",is_floating:!1,is_opened:!1,mob:!1,Pstate:[],createElems:function(){var t=this;return t.E.wrap('
'),t.select=t.E.parent(),t.caption=e(""),t.CaptionCont=e('

').addClass("SelectBox").attr("style",t.E.attr("style")).prepend(t.caption),t.select.append(t.CaptionCont),t.is_multi||(l.okCancelInMulti=!1),t.E.attr("disabled")&&t.select.addClass("disabled").removeAttr("tabindex"),l.outputAsCSV&&t.is_multi&&t.E.attr("name")&&(t.select.append(e('').attr("name",t.E.attr("name")).val(t.getSelStr())),t.E.removeAttr("name")),t.isMobile()&&!l.forceCustomRendering?void t.setNativeMobile():(t.E.attr("name")&&t.select.addClass("sumo_"+t.E.attr("name")),t.E.addClass("SumoUnder").attr("tabindex","-1"),t.optDiv=e('
'),t.floatingList(),t.ul=e('
    '),t.optDiv.append(t.ul),l.selectAll&&t.SelAll(),l.search&&t.Search(),t.ul.append(t.prepItems(t.E.children())),t.is_multi&&t.multiSelelect(),t.select.append(t.optDiv),t.basicEvents(),void t.selAllState())},prepItems:function(t,l){var i=[],s=this;return e(t).each(function(t,n){n=e(n),i.push(n.is("optgroup")?e('
    • ").find("ul").append(s.prepItems(n.children(),n[0].disabled)).end():s.createLi(n,l))}),i},createLi:function(t,l){var i=this;return t.attr("value")||t.attr("value",t.val()),li=e('
    • "),li.data("opt",t),t.data("li",li),i.is_multi&&li.prepend(""),(t[0].disabled||l)&&(li=li.addClass("disabled")),i.onOptClick(li),t[0].selected&&li.addClass("selected"),t.attr("class")&&li.addClass(t.attr("class")),li},getSelStr:function(){return sopt=[],this.E.find("option:selected").each(function(){sopt.push(e(this).val())}),sopt.join(l.csvSepChar)},multiSelelect:function(){var t=this;t.optDiv.addClass("multiple"),t.okbtn=e('

      '+l.locale[0]+"

      ").click(function(){l.triggerChangeCombined&&(changed=!1,t.E.find("option:selected").length!=t.Pstate.length?changed=!0:t.E.find("option").each(function(e,l){l.selected&&t.Pstate.indexOf(e)<0&&(changed=!0)}),changed&&(t.callChange(),t.setText())),t.hideOpts()}),t.cancelBtn=e('

      '+l.locale[1]+"

      ").click(function(){t._cnbtn(),t.hideOpts()}),t.optDiv.append(e('
      ').append(t.okbtn).append(t.cancelBtn))},_cnbtn:function(){var e=this;e.E.find("option:selected").each(function(){this.selected=!1}),e.optDiv.find("li.selected").removeClass("selected");for(var t=0;t

      "),t.selAll.on("click",function(){t.selAll.toggleClass("selected"),t.optDiv.find("li.opt").not(".hidden").each(function(l,i){i=e(i),t.selAll.hasClass("selected")?i.hasClass("selected")||i.trigger("click"):i.hasClass("selected")&&i.trigger("click")})}),t.optDiv.prepend(t.selAll))},Search:function(){var t=this,i=t.CaptionCont.addClass("search"),s=e('

      ');t.ftxt=e('').on("click",function(e){e.stopPropagation()}),i.append(t.ftxt),t.optDiv.children("ul").after(s),t.ftxt.on("keyup.sumo",function(){var i=t.optDiv.find("ul.options li.opt").each(function(l,i){i=e(i),i.text().toLowerCase().indexOf(t.ftxt.val().toLowerCase())>-1?i.removeClass("hidden"):i.addClass("hidden")}).not(".hidden");s.html(l.noMatch.replace(/\{0\}/g,t.ftxt.val())).toggle(!i.length),t.selAllState()})},selAllState:function(){var t=this;if(l.selectAll){var i=0,s=0;t.optDiv.find("li.opt").not(".hidden").each(function(t,l){e(l).hasClass("selected")&&i++,e(l).hasClass("disabled")||s++}),i==s?t.selAll.removeClass("partial").addClass("selected"):0==i?t.selAll.removeClass("selected partial"):t.selAll.addClass("partial")}},showOpts:function(){var t=this;t.E.attr("disabled")||(t.is_opened=!0,t.select.addClass("open"),t.ftxt?t.ftxt.focus():t.select.focus(),e(document).on("click.sumo",function(e){if(!t.select.is(e.target)&&0===t.select.has(e.target).length){if(!t.is_opened)return;t.hideOpts(),l.okCancelInMulti&&t._cnbtn()}}),t.is_floating&&(H=t.optDiv.children("ul").outerHeight()+2,t.is_multi&&(H+=parseInt(t.optDiv.css("padding-bottom"))),t.optDiv.css("height",H),e("body").addClass("sumoStopScroll")),t.setPstate())},setPstate:function(){var e=this;e.is_multi&&(e.is_floating||l.okCancelInMulti)&&(e.Pstate=[],e.E.find("option").each(function(t,l){l.selected&&e.Pstate.push(t)}))},callChange:function(){this.E.trigger("change").trigger("click")},hideOpts:function(){var t=this;t.is_opened&&(t.is_opened=!1,t.select.removeClass("open").find("ul li.sel").removeClass("sel"),e(document).off("click.sumo"),t.select.focus(),e("body").removeClass("sumoStopScroll"),l.search&&(t.ftxt.val(""),t.optDiv.find("ul.options li").removeClass("hidden"),t.optDiv.find(".no-match").toggle(!1)))},setOnOpen:function(){var e=this,t=e.optDiv.find("li.opt:not(.hidden)").eq(l.search?0:e.E[0].selectedIndex);e.optDiv.find("li.sel").removeClass("sel"),t.addClass("sel"),e.showOpts()},nav:function(e){var t,l=this,i=l.ul.find("li.opt:not(.disabled, .hidden)"),s=l.ul.find("li.opt.sel:not(.hidden)"),n=i.index(s);if(l.is_opened&&s.length){if(e&&n>0)t=i.eq(n-1);else{if(!(!e&&n-1))return;t=i.eq(n+1)}s.removeClass("sel"),s=t.addClass("sel");var o=l.ul,a=o.scrollTop(),c=s.position().top+a;c>=a+o.height()-s.outerHeight()&&o.scrollTop(c-o.height()+s.outerHeight()),a>c&&o.scrollTop(c)}else l.setOnOpen()},basicEvents:function(){var t=this;t.CaptionCont.click(function(e){t.E.trigger("click"),t.is_opened?t.hideOpts():t.showOpts(),e.stopPropagation()}),t.select.on("keydown.sumo",function(e){switch(e.which){case 38:t.nav(!0);break;case 40:t.nav(!1);break;case 32:if(l.search&&t.ftxt.is(e.target))return;case 13:t.is_opened?t.optDiv.find("ul li.sel").trigger("click"):t.setOnOpen();break;case 9:case 27:return l.okCancelInMulti&&t._cnbtn(),void t.hideOpts();default:return}e.preventDefault()}),e(window).on("resize.sumo",function(){t.floatingList()})},onOptClick:function(t){var i=this;t.click(function(){var t=e(this);t.hasClass("disabled")||(txt="",i.is_multi?(t.toggleClass("selected"),t.data("opt")[0].selected=t.hasClass("selected"),i.selAllState()):(t.parent().find("li.selected").removeClass("selected"),t.toggleClass("selected"),t.data("opt")[0].selected=!0),i.is_multi&&l.triggerChangeCombined&&(i.is_floating||l.okCancelInMulti)||(i.setText(),i.callChange()),i.is_multi||i.hideOpts())})},setText:function(){var t=this;if(t.placeholder="",t.is_multi){for(sels=t.E.find(":selected").not(":disabled"),i=0;i=l.csvDispCount&&l.csvDispCount){sels.length==t.E.find("option").length&&l.captionFormatAllSelected?t.placeholder=l.captionFormatAllSelected.replace(/\{0\}/g,sels.length)+",":t.placeholder=l.captionFormat.replace(/\{0\}/g,sels.length)+",";break}t.placeholder+=e(sels[i]).text()+", "}t.placeholder=t.placeholder.replace(/,([^,]*)$/,"$1")}else t.placeholder=t.E.find(":selected").not(":disabled").text();return is_placeholder=!1,t.placeholder||(is_placeholder=!0,t.placeholder=t.E.attr("placeholder"),t.placeholder||(t.placeholder=t.E.find("option:disabled:selected").text())),t.placeholder=t.placeholder?l.prefix+" "+t.placeholder:l.placeholder,t.caption.html(t.placeholder),t.CaptionCont.attr("title",t.placeholder),csvField=t.select.find("input.HEMANT123"),csvField.length&&csvField.val(t.getSelStr()),is_placeholder?t.caption.addClass("placeholder"):t.caption.removeClass("placeholder"),t.placeholder},isMobile:function(){for(var e=navigator.userAgent||navigator.vendor||window.opera,t=0;t0)return l.nativeOnDevice[t];return!1},setNativeMobile:function(){var e=this;e.E.addClass("SelectClass"),e.mob=!0,e.E.change(function(){e.setText()})},floatingList:function(){var t=this;t.is_floating=e(window).width()<=l.floatWidth,t.optDiv.toggleClass("isFloating",t.is_floating),t.is_floating||t.optDiv.css("height",""),t.optDiv.toggleClass("okCancelInMulti",l.okCancelInMulti&&!t.is_floating)},vRange:function(e){var t=this;if(opts=t.E.find("option"),opts.length<=e||0>e)throw"index out of bounds";return t},toggSel:function(t,l){var i=this;"number"==typeof l?(i.vRange(l),opt=i.E.find("option")[l]):opt=i.E.find('option[value="'+l+'"]')[0]||0,opt&&!opt.disabled&&opt.selected!=t&&(opt.selected=t,i.mob||e(opt).data("li").toggleClass("selected",t),i.callChange(),i.setPstate(),i.setText(),i.selAllState())},toggDis:function(e,t){var l=this.vRange(t);l.E.find("option")[t].disabled=e,e&&(l.E.find("option")[t].selected=!1),l.mob||l.optDiv.find("ul.options li").eq(t).toggleClass("disabled",e).removeClass("selected"),l.setText()},toggSumo:function(e){var t=this;return t.enabled=e,t.select.toggleClass("disabled",e),e?(t.E.attr("disabled","disabled"),t.select.removeAttr("tabindex")):(t.E.removeAttr("disabled"),t.select.attr("tabindex","0")),t},toggSelAll:function(t){var l=this;l.E.find("option").each(function(){l.E.find("option")[e(this).index()].disabled||(l.E.find("option")[e(this).index()].selected=t,l.mob||l.optDiv.find("ul.options li").eq(e(this).index()).toggleClass("selected",t),l.setText())}),!l.mob&&l.selAll&&l.selAll.removeClass("partial").toggleClass("selected",t),l.callChange(),l.setPstate()},reload:function(){var t=this.unload();return e(t).SumoSelect(l)},unload:function(){var e=this;return e.select.before(e.E),e.E.show(),l.outputAsCSV&&e.is_multi&&e.select.find("input.HEMANT123").length&&e.E.attr("name",e.select.find("input.HEMANT123").attr("name")),e.select.remove(),delete t.sumo,t},add:function(l,i,s){if("undefined"==typeof l)throw"No value to add";var n=this;if(opts=n.E.find("option"),"number"==typeof i&&(s=i,i=l),"undefined"==typeof i&&(i=l),opt=e("").val(l).html(i),opts.length https://www.caroana.com.br/wp-content/plugins/photo-gallery/js/jquery.mobile.js?ver=1.4.7 /*! jQuery Mobile v1.3.2 | Copyright 2010, 2013 jQuery Foundation, Inc. | jquery.org/license */ (function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function x(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function T(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=x(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;di||Math.abs(n.pageY-p)>i,d&&!r&&D("vmousecancel",t,s),D("vmousemove",t,s),M()}function F(e){if(g)return;L();var t=N(e.target),n;D("vmouseup",e,t);if(!d){var r=D("vclick",e,t);r&&r.isDefaultPrevented()&&(n=x(e).changedTouches[0],v.push({touchID:E,x:n.clientX,y:n.clientY}),m=!0)}D("vmouseout",e,t),d=!1,M()}function I(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function q(){}function R(t){var n=t.substr(1);return{setup:function(r,s){I(this)||e.data(this,i,{});var o=e.data(this,i);o[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,P),e(this).bind(n,q),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",H).bind("touchend",F).bind("touchmove",j).bind("scroll",B))},teardown:function(r,s){--l[t],l[t]||b.unbind(n,P),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",H).unbind("touchmove",j).unbind("touchend",F).unbind("scroll",B));var o=e(this),u=e.data(this,i);u&&(u[t]=!1),o.unbind(n,q),I(this)||o.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(var U=0;Ue.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])n.coords[0]?"swipeleft":"swiperight")},setup:function(){var t=this,n=e(t);n.bind(u,function(t){function o(t){if(!i)return;s=e.event.special.swipe.stop(t),Math.abs(i.coords[0]-s.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()}var i=e.event.special.swipe.start(t),s;n.bind(f,o).one(a,function(){n.unbind(f,o),i&&s&&e.event.special.swipe.handleSwipe(i,s),i=s=r})})}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)}}})}(e,this)}); // source --> https://www.caroana.com.br/wp-content/plugins/photo-gallery/js/jquery.mCustomScrollbar.concat.min.js?ver=1.4.7 /*mousewheel*/ (function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); /*custom scrollbar*/ (function(c){var b={init:function(e){var f={set_width:false,set_height:false,horizontalScroll:false,scrollInertia:950,mouseWheel:true,mouseWheelPixels:"auto",autoDraggerLength:true,autoHideScrollbar:false,snapAmount:null,snapOffset:0,scrollButtons:{enable:false,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:true,updateOnContentResize:false,autoExpandHorizontalScroll:false,autoScrollOnFocus:true,normalizeMouseWheelDelta:false},contentTouchScroll:true,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},e=c.extend(true,f,e);return this.each(function(){var m=c(this);if(e.set_width){m.css("width",e.set_width)}if(e.set_height){m.css("height",e.set_height)}if(!c(document).data("mCustomScrollbar-index")){c(document).data("mCustomScrollbar-index","1")}else{var t=parseInt(c(document).data("mCustomScrollbar-index"));c(document).data("mCustomScrollbar-index",t+1)}m.wrapInner("

      ").addClass("mCustomScrollbar _mCS_"+c(document).data("mCustomScrollbar-index"));var g=m.children(".mCustomScrollBox");if(e.horizontalScroll){g.addClass("mCSB_horizontal").wrapInner("
      ");var k=g.children(".mCSB_h_wrapper");k.wrapInner("
      ").children(".mCSB_container").css({width:k.children().outerWidth(),position:"relative"}).unwrap()}else{g.wrapInner("
      ")}var o=g.children(".mCSB_container");if(c.support.touch){o.addClass("mCS_touch")}o.after("
      ");var l=g.children(".mCSB_scrollTools"),h=l.children(".mCSB_draggerContainer"),q=h.children(".mCSB_dragger");if(e.horizontalScroll){q.data("minDraggerWidth",q.width())}else{q.data("minDraggerHeight",q.height())}if(e.scrollButtons.enable){if(e.horizontalScroll){l.prepend("").append("")}else{l.prepend("").append("")}}g.bind("scroll",function(){if(!m.is(".mCS_disabled")){g.scrollTop(0).scrollLeft(0)}});m.data({mCS_Init:true,mCustomScrollbarIndex:c(document).data("mCustomScrollbar-index"),horizontalScroll:e.horizontalScroll,scrollInertia:e.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:e.mouseWheel,mouseWheelPixels:e.mouseWheelPixels,autoDraggerLength:e.autoDraggerLength,autoHideScrollbar:e.autoHideScrollbar,snapAmount:e.snapAmount,snapOffset:e.snapOffset,scrollButtons_enable:e.scrollButtons.enable,scrollButtons_scrollType:e.scrollButtons.scrollType,scrollButtons_scrollSpeed:e.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:e.scrollButtons.scrollAmount,autoExpandHorizontalScroll:e.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:e.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:e.advanced.normalizeMouseWheelDelta,contentTouchScroll:e.contentTouchScroll,onScrollStart_Callback:e.callbacks.onScrollStart,onScroll_Callback:e.callbacks.onScroll,onTotalScroll_Callback:e.callbacks.onTotalScroll,onTotalScrollBack_Callback:e.callbacks.onTotalScrollBack,onTotalScroll_Offset:e.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:e.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:e.callbacks.whileScrolling,bindEvent_scrollbar_drag:false,bindEvent_content_touch:false,bindEvent_scrollbar_click:false,bindEvent_mousewheel:false,bindEvent_buttonsContinuous_y:false,bindEvent_buttonsContinuous_x:false,bindEvent_buttonsPixels_y:false,bindEvent_buttonsPixels_x:false,bindEvent_focusin:false,bindEvent_autoHideScrollbar:false,mCSB_buttonScrollRight:false,mCSB_buttonScrollLeft:false,mCSB_buttonScrollDown:false,mCSB_buttonScrollUp:false});if(e.horizontalScroll){if(m.css("max-width")!=="none"){if(!e.advanced.updateOnContentResize){e.advanced.updateOnContentResize=true}}}else{if(m.css("max-height")!=="none"){var s=false,r=parseInt(m.css("max-height"));if(m.css("max-height").indexOf("%")>=0){s=r,r=m.parent().height()*s/100}m.css("overflow","hidden");g.css("max-height",r)}}m.mCustomScrollbar("update");if(e.advanced.updateOnBrowserResize){var i,j=c(window).width(),u=c(window).height();c(window).bind("resize."+m.data("mCustomScrollbarIndex"),function(){if(i){clearTimeout(i)}i=setTimeout(function(){if(!m.is(".mCS_disabled")&&!m.is(".mCS_destroyed")){var w=c(window).width(),v=c(window).height();if(j!==w||u!==v){if(m.css("max-height")!=="none"&&s){g.css("max-height",m.parent().height()*s/100)}m.mCustomScrollbar("update");j=w;u=v}}},150)})}if(e.advanced.updateOnContentResize){var p;if(e.horizontalScroll){var n=o.outerWidth()}else{var n=o.outerHeight()}p=setInterval(function(){if(e.horizontalScroll){if(e.advanced.autoExpandHorizontalScroll){o.css({position:"absolute",width:"auto"}).wrap("
      ").css({width:o.outerWidth(),position:"relative"}).unwrap()}var v=o.outerWidth()}else{var v=o.outerHeight()}if(v!=n){m.mCustomScrollbar("update");n=v}},300)}})},update:function(){var n=c(this),k=n.children(".mCustomScrollBox"),q=k.children(".mCSB_container");q.removeClass("mCS_no_scrollbar");n.removeClass("mCS_disabled mCS_destroyed");k.scrollTop(0).scrollLeft(0);var y=k.children(".mCSB_scrollTools"),o=y.children(".mCSB_draggerContainer"),m=o.children(".mCSB_dragger");if(n.data("horizontalScroll")){var A=y.children(".mCSB_buttonLeft"),t=y.children(".mCSB_buttonRight"),f=k.width();if(n.data("autoExpandHorizontalScroll")){q.css({position:"absolute",width:"auto"}).wrap("
      ").css({width:q.outerWidth(),position:"relative"}).unwrap()}var z=q.outerWidth()}else{var w=y.children(".mCSB_buttonUp"),g=y.children(".mCSB_buttonDown"),r=k.height(),i=q.outerHeight()}if(i>r&&!n.data("horizontalScroll")){y.css("display","block");var s=o.height();if(n.data("autoDraggerLength")){var u=Math.round(r/i*s),l=m.data("minDraggerHeight");if(u<=l){m.css({height:l})}else{if(u>=s-10){var p=s-10;m.css({height:p})}else{m.css({height:u})}}m.children(".mCSB_dragger_bar").css({"line-height":m.height()+"px"})}var B=m.height(),x=(i-r)/(s-B);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().top);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{if(z>f&&n.data("horizontalScroll")){y.css("display","block");var h=o.width();if(n.data("autoDraggerLength")){var j=Math.round(f/z*h),C=m.data("minDraggerWidth");if(j<=C){m.css({width:C})}else{if(j>=h-10){var e=h-10;m.css({width:e})}else{m.css({width:j})}}}var v=m.width(),x=(z-f)/(h-v);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().left);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{k.unbind("mousewheel focusin");if(n.data("horizontalScroll")){m.add(q).css("left",0)}else{m.add(q).css("top",0)}y.css("display","none");q.addClass("mCS_no_scrollbar");n.data({bindEvent_mousewheel:false,bindEvent_focusin:false})}}},scrolling:function(h,p,m,j,w,e,A,v){var k=c(this);if(!k.data("bindEvent_scrollbar_drag")){var n,o;if(c.support.msPointer){j.bind("MSPointerDown",function(H){H.preventDefault();k.data({on_drag:true});j.addClass("mCSB_dragger_onDrag");var G=c(this),J=G.offset(),F=H.originalEvent.pageX-J.left,I=H.originalEvent.pageY-J.top;if(F0&&I0){n=I;o=F}});c(document).bind("MSPointerMove."+k.data("mCustomScrollbarIndex"),function(H){H.preventDefault();if(k.data("on_drag")){var G=j,J=G.offset(),F=H.originalEvent.pageX-J.left,I=H.originalEvent.pageY-J.top;D(n,o,I,F)}}).bind("MSPointerUp."+k.data("mCustomScrollbarIndex"),function(x){k.data({on_drag:false});j.removeClass("mCSB_dragger_onDrag")})}else{j.bind("mousedown touchstart",function(H){H.preventDefault();H.stopImmediatePropagation();var G=c(this),K=G.offset(),F,J;if(H.type==="touchstart"){var I=H.originalEvent.touches[0]||H.originalEvent.changedTouches[0];F=I.pageX-K.left;J=I.pageY-K.top}else{k.data({on_drag:true});j.addClass("mCSB_dragger_onDrag");F=H.pageX-K.left;J=H.pageY-K.top}if(F0&&J0){n=J;o=F}}).bind("touchmove",function(H){H.preventDefault();H.stopImmediatePropagation();var K=H.originalEvent.touches[0]||H.originalEvent.changedTouches[0],G=c(this),J=G.offset(),F=K.pageX-J.left,I=K.pageY-J.top;D(n,o,I,F)});c(document).bind("mousemove."+k.data("mCustomScrollbarIndex"),function(H){if(k.data("on_drag")){var G=j,J=G.offset(),F=H.pageX-J.left,I=H.pageY-J.top;D(n,o,I,F)}}).bind("mouseup."+k.data("mCustomScrollbarIndex"),function(x){k.data({on_drag:false});j.removeClass("mCSB_dragger_onDrag")})}k.data({bindEvent_scrollbar_drag:true})}function D(G,H,I,F){if(k.data("horizontalScroll")){k.mCustomScrollbar("scrollTo",(j.position().left-(H))+F,{moveDragger:true,trigger:"internal"})}else{k.mCustomScrollbar("scrollTo",(j.position().top-(G))+I,{moveDragger:true,trigger:"internal"})}}if(c.support.touch&&k.data("contentTouchScroll")){if(!k.data("bindEvent_content_touch")){var l,B,r,s,u,C,E;p.bind("touchstart",function(x){x.stopImmediatePropagation();l=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];B=c(this);r=B.offset();u=l.pageX-r.left;s=l.pageY-r.top;C=s;E=u});p.bind("touchmove",function(x){x.preventDefault();x.stopImmediatePropagation();l=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];B=c(this).parent();r=B.offset();u=l.pageX-r.left;s=l.pageY-r.top;if(k.data("horizontalScroll")){k.mCustomScrollbar("scrollTo",E-u,{trigger:"internal"})}else{k.mCustomScrollbar("scrollTo",C-s,{trigger:"internal"})}})}}if(!k.data("bindEvent_scrollbar_click")){m.bind("click",function(F){var x=(F.pageY-m.offset().top)*k.data("scrollAmount"),y=c(F.target);if(k.data("horizontalScroll")){x=(F.pageX-m.offset().left)*k.data("scrollAmount")}if(y.hasClass("mCSB_draggerContainer")||y.hasClass("mCSB_draggerRail")){k.mCustomScrollbar("scrollTo",x,{trigger:"internal",scrollEasing:"draggerRailEase"})}});k.data({bindEvent_scrollbar_click:true})}if(k.data("mouseWheel")){if(!k.data("bindEvent_mousewheel")){h.bind("mousewheel",function(H,J){var G,F=k.data("mouseWheelPixels"),x=Math.abs(p.position().top),I=j.position().top,y=m.height()-j.height();if(k.data("normalizeMouseWheelDelta")){if(J<0){J=-1}else{J=1}}if(F==="auto"){F=100+Math.round(k.data("scrollAmount")/2)}if(k.data("horizontalScroll")){I=j.position().left;y=m.width()-j.width();x=Math.abs(p.position().left)}if((J>0&&I!==0)||(J<0&&I!==y)){H.preventDefault();H.stopImmediatePropagation()}G=x-(J*F);k.mCustomScrollbar("scrollTo",G,{trigger:"internal"})});k.data({bindEvent_mousewheel:true})}}if(k.data("scrollButtons_enable")){if(k.data("scrollButtons_scrollType")==="pixels"){if(k.data("horizontalScroll")){v.add(A).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",i,g);k.data({bindEvent_buttonsContinuous_x:false});if(!k.data("bindEvent_buttonsPixels_x")){v.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().left)+k.data("scrollButtons_scrollAmount"))});A.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().left)-k.data("scrollButtons_scrollAmount"))});k.data({bindEvent_buttonsPixels_x:true})}}else{e.add(w).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",i,g);k.data({bindEvent_buttonsContinuous_y:false});if(!k.data("bindEvent_buttonsPixels_y")){e.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().top)+k.data("scrollButtons_scrollAmount"))});w.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().top)-k.data("scrollButtons_scrollAmount"))});k.data({bindEvent_buttonsPixels_y:true})}}function q(x){if(!j.data("preventAction")){j.data("preventAction",true);k.mCustomScrollbar("scrollTo",x,{trigger:"internal"})}}}else{if(k.data("horizontalScroll")){v.add(A).unbind("click");k.data({bindEvent_buttonsPixels_x:false});if(!k.data("bindEvent_buttonsContinuous_x")){v.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollRight:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().left)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var i=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollRight"))};v.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",i);A.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollLeft:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().left)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var g=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollLeft"))};A.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",g);k.data({bindEvent_buttonsContinuous_x:true})}}else{e.add(w).unbind("click");k.data({bindEvent_buttonsPixels_y:false});if(!k.data("bindEvent_buttonsContinuous_y")){e.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollDown:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().top)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var t=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollDown"))};e.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",t);w.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollUp:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().top)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var f=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollUp"))};w.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",f);k.data({bindEvent_buttonsContinuous_y:true})}}function z(){var x=k.data("scrollButtons_scrollSpeed");if(k.data("scrollButtons_scrollSpeed")==="auto"){x=Math.round((k.data("scrollInertia")+100)/40)}return x}}}if(k.data("autoScrollOnFocus")){if(!k.data("bindEvent_focusin")){h.bind("focusin",function(){h.scrollTop(0).scrollLeft(0);var x=c(document.activeElement);if(x.is("input,textarea,select,button,a[tabindex],area,object")){var G=p.position().top,y=x.position().top,F=h.height()-x.outerHeight();if(k.data("horizontalScroll")){G=p.position().left;y=x.position().left;F=h.width()-x.outerWidth()}if(G+y<0||G+y>F){k.mCustomScrollbar("scrollTo",y,{trigger:"internal"})}}});k.data({bindEvent_focusin:true})}}if(k.data("autoHideScrollbar")){if(!k.data("bindEvent_autoHideScrollbar")){h.bind("mouseenter",function(x){h.addClass("mCS-mouse-over");d.showScrollbar.call(h.children(".mCSB_scrollTools"))}).bind("mouseleave touchend",function(x){h.removeClass("mCS-mouse-over");if(x.type==="mouseleave"){d.hideScrollbar.call(h.children(".mCSB_scrollTools"))}});k.data({bindEvent_autoHideScrollbar:true})}}},scrollTo:function(e,f){var i=c(this),o={moveDragger:false,trigger:"external",callbacks:true,scrollInertia:i.data("scrollInertia"),scrollEasing:i.data("scrollEasing")},f=c.extend(o,f),p,g=i.children(".mCustomScrollBox"),k=g.children(".mCSB_container"),r=g.children(".mCSB_scrollTools"),j=r.children(".mCSB_draggerContainer"),h=j.children(".mCSB_dragger"),t=draggerSpeed=f.scrollInertia,q,s,m,l;if(!k.hasClass("mCS_no_scrollbar")){i.data({mCS_trigger:f.trigger});if(i.data("mCS_Init")){f.callbacks=false}if(e||e===0){if(typeof(e)==="number"){if(f.moveDragger){p=e;if(i.data("horizontalScroll")){e=h.position().left*i.data("scrollAmount")}else{e=h.position().top*i.data("scrollAmount")}draggerSpeed=0}else{p=e/i.data("scrollAmount")}}else{if(typeof(e)==="string"){var v;if(e==="top"){v=0}else{if(e==="bottom"&&!i.data("horizontalScroll")){v=k.outerHeight()-g.height()}else{if(e==="left"){v=0}else{if(e==="right"&&i.data("horizontalScroll")){v=k.outerWidth()-g.width()}else{if(e==="first"){v=i.find(".mCSB_container").find(":first")}else{if(e==="last"){v=i.find(".mCSB_container").find(":last")}else{v=i.find(e)}}}}}}if(v.length===1){if(i.data("horizontalScroll")){e=v.position().left}else{e=v.position().top}p=e/i.data("scrollAmount")}else{p=e=v}}}if(i.data("horizontalScroll")){if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.width()-k.outerWidth()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollLeft"));if(!s){q=true}}else{if(p>=j.width()-h.width()){p=j.width()-h.width();e=g.width()-k.outerWidth();clearInterval(i.data("mCSB_buttonScrollRight"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"left",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"left",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().left>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().left<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}else{if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.height()-k.outerHeight()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollUp"));if(!s){q=true}}else{if(p>=j.height()-h.height()){p=j.height()-h.height();e=g.height()-k.outerHeight();clearInterval(i.data("mCSB_buttonScrollDown"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"top",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"top",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().top>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().top<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}if(i.data("mCS_Init")){i.data({mCS_Init:false})}}}function u(w){this.mcs={top:k.position().top,left:k.position().left,draggerTop:h.position().top,draggerLeft:h.position().left,topPct:Math.round((100*Math.abs(k.position().top))/Math.abs(k.outerHeight()-g.height())),leftPct:Math.round((100*Math.abs(k.position().left))/Math.abs(k.outerWidth()-g.width()))};switch(w){case"onScrollStart":i.data("mCS_tweenRunning",true).data("onScrollStart_Callback").call(i,this.mcs);break;case"whileScrolling":i.data("whileScrolling_Callback").call(i,this.mcs);break;case"onScroll":i.data("onScroll_Callback").call(i,this.mcs);break;case"onTotalScrollBack":i.data("onTotalScrollBack_Callback").call(i,this.mcs);break;case"onTotalScroll":i.data("onTotalScroll_Callback").call(i,this.mcs);break}}},stop:function(){var g=c(this),e=g.children().children(".mCSB_container"),f=g.children().children().children().children(".mCSB_dragger");d.mTweenAxisStop.call(this,e[0]);d.mTweenAxisStop.call(this,f[0])},disable:function(e){var j=c(this),f=j.children(".mCustomScrollBox"),h=f.children(".mCSB_container"),g=f.children(".mCSB_scrollTools"),i=g.children().children(".mCSB_dragger");f.unbind("mousewheel focusin mouseenter mouseleave touchend");h.unbind("touchstart touchmove");if(e){if(j.data("horizontalScroll")){i.add(h).css("left",0)}else{i.add(h).css("top",0)}}g.css("display","none");h.addClass("mCS_no_scrollbar");j.data({bindEvent_mousewheel:false,bindEvent_focusin:false,bindEvent_content_touch:false,bindEvent_autoHideScrollbar:false}).addClass("mCS_disabled")},destroy:function(){var e=c(this);e.removeClass("mCustomScrollbar _mCS_"+e.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();c(document).unbind("mousemove."+e.data("mCustomScrollbarIndex")+" mouseup."+e.data("mCustomScrollbarIndex")+" MSPointerMove."+e.data("mCustomScrollbarIndex")+" MSPointerUp."+e.data("mCustomScrollbarIndex"));c(window).unbind("resize."+e.data("mCustomScrollbarIndex"))}},d={showScrollbar:function(){this.stop().animate({opacity:1},"fast")},hideScrollbar:function(){this.stop().animate({opacity:0},"fast")},mTweenAxis:function(g,i,h,f,o,y){var y=y||{},v=y.onStart||function(){},p=y.onUpdate||function(){},w=y.onComplete||function(){};var n=t(),l,j=0,r=g.offsetTop,s=g.style;if(i==="left"){r=g.offsetLeft}var m=h-r;q();e();function t(){if(window.performance&&window.performance.now){return window.performance.now()}else{if(window.performance&&window.performance.webkitNow){return window.performance.webkitNow()}else{if(Date.now){return Date.now()}else{return new Date().getTime()}}}}function x(){if(!j){v.call()}j=t()-n;u();if(j>=g._time){g._time=(j>g._time)?j+l-(j-g._time):j+l-1;if(g._time0){g.currVal=k(g._time,r,m,f,o);s[i]=Math.round(g.currVal)+"px"}else{s[i]=h+"px"}p.call()}function e(){l=1000/60;g._time=j+l;_request=(!window.requestAnimationFrame)?function(z){u();return setTimeout(z,0.01)}:window.requestAnimationFrame;g._id=_request(x)}function q(){if(g._id==null){return}if(!window.requestAnimationFrame){clearTimeout(g._id)}else{window.cancelAnimationFrame(g._id)}g._id=null}function k(B,A,F,E,C){switch(C){case"linear":return F*B/E+A;break;case"easeOutQuad":B/=E;return -F*B*(B-2)+A;break;case"easeInOutQuad":B/=E/2;if(B<1){return F/2*B*B+A}B--;return -F/2*(B*(B-2)-1)+A;break;case"easeOutCubic":B/=E;B--;return F*(B*B*B+1)+A;break;case"easeOutQuart":B/=E;B--;return -F*(B*B*B*B-1)+A;break;case"easeOutQuint":B/=E;B--;return F*(B*B*B*B*B+1)+A;break;case"easeOutCirc":B/=E;B--;return F*Math.sqrt(1-B*B)+A;break;case"easeOutSine":return F*Math.sin(B/E*(Math.PI/2))+A;break;case"easeOutExpo":return F*(-Math.pow(2,-10*B/E)+1)+A;break;case"mcsEaseOut":var D=(B/=E)*B,z=D*B;return A+F*(0.499999999999997*z*D+-2.5*D*D+5.5*z+-6.5*D+4*B);break;case"draggerRailEase":B/=E/2;if(B<1){return F/2*B*B*B+A}B-=2;return F/2*(B*B*B+2)+A;break}}},mTweenAxisStop:function(e){if(e._id==null){return}if(!window.requestAnimationFrame){clearTimeout(e._id)}else{window.cancelAnimationFrame(e._id)}e._id=null},rafPolyfill:function(){var f=["ms","moz","webkit","o"],e=f.length;while(--e>-1&&!window.requestAnimationFrame){window.requestAnimationFrame=window[f[e]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[f[e]+"CancelAnimationFrame"]||window[f[e]+"CancelRequestAnimationFrame"]}}};d.rafPolyfill.call();c.support.touch=!!("ontouchstart" in window);c.support.msPointer=window.navigator.msPointerEnabled;var a=("https:"==document.location.protocol)?"https:":"http:";c.event.special.mousewheel||document.write('